using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace ScottLane.VideoInbox
{
    /// <summary>
    /// Represents a video.
    /// </summary>
    public class Video
    {
        #region Constructor

        /// <summary>
        /// Initializes a new instace of the Video class.
        /// </summary>
        public Video()
        {
            _shortcuts = new List<Shortcut>();
        }

        #endregion

        #region Properties

        private Uri _sourceLocation;

        /// <summary>
        /// Gets or sets the video source location uri.
        /// </summary>
        [XmlIgnore]
        public Uri SourceLocation
        {
            get { return _sourceLocation; }
            set { _sourceLocation = value; }
        }

        /// <summary>
        /// Gets or sets the video source location absolute uri.
        /// </summary>
        [XmlElement("SourceLocation")]
        public string SourceLocationString
        {
            get { return _sourceLocation.AbsoluteUri; }
            set { _sourceLocation = new Uri(value); }
        }

        private string _title;

        /// <summary>
        /// Gets or sets the video title.
        /// </summary>
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        private DateTime _created;

        /// <summary>
        /// Gets or sets the date that the video was created.
        /// </summary>
        public DateTime Created
        {
            get { return _created; }
            set { _created = value; }
        }

        private List<Shortcut> _shortcuts;

        /// <summary>
        /// Gets or sets the additional shortcuts that will be created to link to the video.
        /// </summary>
        public List<Shortcut> Shortcuts
        {
            get { return _shortcuts; }
            set { _shortcuts = value; }
        }

        #endregion Properties
    }
}
